/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-01-12 09:35:49
 * @LastEditTime : 2023-08-07 11:12:00
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Router\MenuNav\TwoRouter\UserGroup.jsx
 * @Description  :
 */
import { API_LIST } from '../../../Api/Api'
import { commonTableList } from '../Common/common'
import { DelDataButton, OpenThrTouter } from '../Common/options'

export const UserGroup = async ({ OptionsEvent, oneData, Permission, actionRef, ClientData }) => {
    let data = {
        pageSize: 10,
        hideInSearch: true,
        params: { UserGroupUuid: oneData.uuid },
        get: API_LIST()['getUserGroupDetailTwo'],
        options: [
            <OpenThrTouter
                title="添加人员"
                type="primary"
                icon="add"
                modal="SelectModal"
                OptionsEvent={OptionsEvent}
                other={{
                    page: 'UserGroupDetail',
                    actionRef,
                    Permission,
                    twoData: oneData,
                    ClientData,
                }}
            />,
        ],
        columns: [
            commonTableList.uuid,
            {
                dataIndex: 'organizationUuid',
                title: '组织机构',
                rules: true,
                valueType: 'select',
                valueEnum: ClientData.organization,
                ellipsis: true,
                hideInTable: true,
            },
            {
                dataIndex: 'organizationName',
                title: '组织机构',
                rules: true,
                valueType: 'input',
                ellipsis: true,
                hideInSearch: true,
            },
            { ...commonTableList.tableName, title: '账户', hideInSearch: false },
            { ...commonTableList.fullName, title: '姓名', hideInSearch: false },
            {
                dataIndex: 'idCard',
                title: '身份证',
                rules: true,
                valueType: 'input',
                ellipsis: true,
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 220,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        <DelDataButton
                            OptionsEvent={OptionsEvent}
                            key="del"
                            title="删除"
                            url="UserGroupDetail"
                            uuid={record.uuid}
                        />,
                    ]
                },
            },
        ],
    }
    return data
}
